<?php
require_once(OC_App::getAppPath('company') . "/lib/quota.php");

if (!PFactory::isMasterUser())
   exit();

$imgfile = JRequest::getString('img', ''); 

if (empty($imgfile))
   exit();

$company_id = PFactory::getMasterUser()->id;
$imgfile = COMPANY_ORDER_IMAGE_BASE . "/$company_id/" . $imgfile;
if (file_exists($imgfile)) {
   $content = file_get_contents($imgfile);
   header('Content-type: '.mime_content_type($imgfile));
   header('Content-Length: '.strlen($content));
   echo $content;
} else {
   echo 'File Not Found';
}
